package com.ruoyi.merchant.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.DataMatchOrderInfoMapper;
import com.ruoyi.db.domain.DataMatchOrderInfo;
import com.ruoyi.merchant.service.IDataMatchOrderInfoService;

/**
 * 商户匹配订单信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-10-26
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class DataMatchOrderInfoServiceImpl implements IDataMatchOrderInfoService 
{
    @Autowired
    private DataMatchOrderInfoMapper dataMatchOrderInfoMapper;

    /**
     * 查询商户匹配订单信息
     * 
     * @param id 商户匹配订单信息主键
     * @return 商户匹配订单信息
     */
    @Override
    public DataMatchOrderInfo selectDataMatchOrderInfoById(Long id)
    {
        return dataMatchOrderInfoMapper.selectDataMatchOrderInfoById(id);
    }

    /**
     * 查询商户匹配订单信息列表
     * 
     * @param dataMatchOrderInfo 商户匹配订单信息
     * @return 商户匹配订单信息
     */
    @Override
    public List<DataMatchOrderInfo> selectDataMatchOrderInfoList(DataMatchOrderInfo dataMatchOrderInfo)
    {
        return dataMatchOrderInfoMapper.selectDataMatchOrderInfoList(dataMatchOrderInfo);
    }

    /**
     * 查询商户匹配订单信息列表
     *
     * @param dataMatchOrderInfo 商户匹配订单信息
     * @return 商户匹配订单信息
     */
    @Override
    public List<Map<String, Object>> selectDataMatchOrderInfoMapList(DataMatchOrderInfo dataMatchOrderInfo)
    {
        return dataMatchOrderInfoMapper.selectDataMatchOrderInfoMapList(dataMatchOrderInfo);
    }

    /**
     * 新增商户匹配订单信息
     * 
     * @param dataMatchOrderInfo 商户匹配订单信息
     * @return 结果
     */
    @Override
    public int insertDataMatchOrderInfo(DataMatchOrderInfo dataMatchOrderInfo)
    {
        dataMatchOrderInfo.setCreateTime(DateUtils.getNowDate());
        return dataMatchOrderInfoMapper.insertDataMatchOrderInfo(dataMatchOrderInfo);
    }

    /**
     * 修改商户匹配订单信息
     * 
     * @param dataMatchOrderInfo 商户匹配订单信息
     * @return 结果
     */
    @Override
    public int updateDataMatchOrderInfo(DataMatchOrderInfo dataMatchOrderInfo)
    {
        dataMatchOrderInfo.setUpdateTime(DateUtils.getNowDate());
        return dataMatchOrderInfoMapper.updateDataMatchOrderInfo(dataMatchOrderInfo);
    }

    /**
     * 批量删除商户匹配订单信息
     * 
     * @param ids 需要删除的商户匹配订单信息主键
     * @return 结果
     */
    @Override
    public int deleteDataMatchOrderInfoByIds(Long[] ids)
    {
        return dataMatchOrderInfoMapper.deleteDataMatchOrderInfoByIds(ids);
    }

    /**
     * 删除商户匹配订单信息信息
     * 
     * @param id 商户匹配订单信息主键
     * @return 结果
     */
    @Override
    public int deleteDataMatchOrderInfoById(Long id)
    {
        return dataMatchOrderInfoMapper.deleteDataMatchOrderInfoById(id);
    }
}
